'''
先定位一个父标签，在父标签的基础上进行再次定位子标签 类似于缩小定位范围，然后再次定位
父标签对象.find_element()
'''
import time


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait

driver = webdriver.Edge()
driver.get("http://www.baidu.com")
time.sleep(3)

# 定位百度左上角的div
dive = driver.find_element(By.ID,"s-top-left")
aes = dive.find_elements(By.TAG_NAME,"a")
for a in aes:
    print(a.text)
